$(document).ready(function(){
//	
//	/**
//	$('#formPage').live('pagebeforeshow', function(){
//		$("input[type='radio']:first").attr("checked",true).checkboxradio("refresh");
//		
//		$("input[type='checkbox']:first").attr("checked",true).checkboxradio("refresh");
//		
//		var myselect = $('select#select-choice-1');
//		myselect[0].selectedIndex = 1;
//		myselect.selectmenu('refresh');
//		
//		$("input[type='range']:first").val('40').slider("refresh");
//		
//		var myswitch = $('select#slider');
//		myswitch[0].selectedIndex = 1;
//		myswitch.slider('refresh');
//		
//	});
//	**/
//	alert(11);
//	
//	
//	$("[name='note_list_li_tpl']").bind("click",function(){
//		var note_id=$("[dbfield='note_id']",this).html();
//		alert(note_id);
//	});

var CBlogPage = PageTpl.extend({
		constructor : function(config) {
			this.version = "1.0";
			this.param ={};
			this.action_type="";
		},		
		record_event:function(data,currJq){
			//对每一个li（currJq）进行数据（data）处理
			commonJS.setInputDomain(data,currJq);
			currJq.data=data;
			currJq.bind("click",function(){
				chose_note=data;
				//currJq.find("a").click();
			});
		},
		tab_click:function(paramext){
			if(!paramext){
				paramext={};
			}
			window.qryPager = null;
			var attribute = {"clone_scope":"note_list_ul","clone_elt":"note_list_li_tpl"};
			this.set_attr(attribute);
			//jQuery.extend(this.param,cloneByFields(clickJq,"method,service_name,page_size,rel_tab"));
//			paramext["page_size"]="10";
//			paramext['state']='1';
//			paramext['groupid']=groupid;
//			jQuery.extend(this.param,paramext);
//			$("[dbfield='group_visible_blog_count']").html(Grp_form.data.group_visible_blog_count);
			this.query_info(paramext);
		}
	});
	window.BlogPage = new CBlogPage();
	BlogPage.tab_click();
});


(function(scope) {
	
	
}(window));
//BlogPage.tab_click();




$('#insert_note').live('pagebeforeshow', function(e) {
	var note_id=$("#note_id",$("#")).html();
	$('#insert_note').find('#note_id').val(note_id);
//	$('#hidden_form_frame').bind('onload',function(){
//		onIFrameLoaded(this);
//	});
});
var chose_note=null;
$('#detail_note').live('pagebeforeshow', function(e) {
	$('#detail_note').find("[dbfield='nickname']").html(chose_note.nickname);
	$('#detail_note').find("[dbfield='brief']").html(chose_note.brief);
});


function updateStatus_form_onSubmit(){
	if($('#updateStatus_form').find('#comments').val()==''){
		alert('请输入微博内容');
		return ;
	}
	$('#updateStatus_form')[0].submit();
}


function note_form_submit() {
//	var form_map=getFormDataMap("note_form");
//	$(window.frames["hidden_form_frame"].document).find("[dbfield='nickname']").val(form_map.nickname); 
//	$(window.frames["hidden_form_frame"].document).find("[dbfield='brief']").val(form_map.brief);
//	$(window.frames["hidden_form_frame"].document).find("#hidden_note_form").submit(); 
//	 $.post("http://peaceful-tor-4422.herokuapp.com/users", getFormDataMap("note_form"), function(reply) {
//    if (reply) {
//    	alert(111);
//    }
//},'json');
	
	$('#note_form')[0].submit();
//	if($(window.frames["hidden_form_frame"].document)){
//		alert($(window.frames["hidden_form_frame"].document).html());
//		var result_map=eval($(window.frames["hidden_form_frame"].document).html());
//		alert(result_map);
//	}
}

function onIFrameLoaded(iframe) {
    var doc = iframe.document;
    var html = doc.body.innerHTML;
    if (html != '') {
        alert(html);
    }
}
	